Back


Goal 8: Decent work and economic growth

GDP per capita


FN 8.1.1 Real growth in GDP per capita
# Import
NRX10_raw <- 
  statgl_url("NRX10", lang = language) %>% 
  statgl_fetch(
    units     = "K",
    account   = "02",
    Aar       = px_all(),
    .col_code = TRUE
               ) %>% 
  as_tibble()

# transform 
NRX10 <- 
  NRX10_raw %>% 
  rename("time" = "Aar") %>% 
  mutate(time = time %>% as.numeric()) %>% 
  mutate(value = (value - lag(value)) / lag(value))


NRX10 %>% 
  ggplot(aes(
    x = time,
    y = value,
    fill = account
  )) +
  geom_col() +
  scale_fill_statgl() + 
  theme_statgl() +
  theme(legend.position = "none") +
  scale_y_continuous(labels = scales::percent_format(
    scale        = 100, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig1$title[language],
    subtitle = NRX10[[1]][1],
    x        = " ",
    y        = sdg8$fig$fig1$y_lab[language],
    fill     = " ",
    caption  = sdg8$fig$fig1$cap[language]
  )

Statbank, GDP

Statbank, employment


tab <- 
  NRX10 %>% 
  mutate(value = value*100) %>% 
  filter(time >= max(time) - 5) %>% 
  arrange(desc(time)) %>% 
  select(-account) %>% 
  mutate(time = time %>% as.character())


if(language != "en"){
  
  table <- 
    tab %>% 
    select(-units) %>% 
    mutate(value = value %>% round(1)) %>% 
    rename(" " = 1, "Realvækst" = value) %>% 
    statgl_table() %>% 
    pack_rows(index = tab[[1]] %>% table()) %>% 
    add_footnote(sdg8$fig$fig1$foot1[language], notation = "symbol")
  
} else {
  
   table <- 
    tab %>% 
    select(-units) %>% 
    mutate(value = value %>% round(1)) %>% 
    rename(" " = 1, "Real growth rate" = value) %>% 
    statgl_table() %>% 
    pack_rows(index = tab[[1]] %>% table()) %>% 
    add_footnote(sdg8$fig$fig1$foot1[language], notation = "symbol")

}


table
Real growth rate
2010-prices, chained values
2021 0,7
2020 0,0
2019 2,6
2018 0,6
2017 0,0
2016 4,9
* Real growth, GDP per capita

Employment


GS Employment rate
# Import

url <- paste0("https://bank.stat.gl/api/v1/", language, "/Greenland/AR/AR30/ARXBFB05.px")

ARXBFB05_raw <-
  url |> 
  statgl_fetch(
    time                 = px_all(),
    municipality         = px_all(),
    "inventory variable" = "H",
    .col_code            = T
  ) |> 
  as_tibble()


# Transform
ARXBFB05 <- 
  ARXBFB05_raw %>% 
  mutate(time = time %>% make_date(),
         municipality = municipality %>% factor(levels = unique(municipality)))

# Plot
ARXBFB05 %>% 
  filter(municipality == ARXBFB05[[1]][1]) %>% 
  ggplot(aes(
    x     = time,
    y     = value,
    color = municipality
    )) +
  geom_line(size = 2) +
  facet_wrap(~ municipality, scales = "free") +
    scale_y_continuous(labels = scales::percent_format(
      scale      = 1, 
      accuracy   = 0.1, 
      big.mark   = ".",
      decimal.mark = ","
      )) +
  theme_statgl() + 
  scale_color_statgl() +
  theme(legend.position = "none") +
  labs(
    title    = sdg8$fig$fig2$title[language],
    subtitle = ARXBFB05[[1]][1],
    x        = " ",
    y        = " ",
    caption  = sdg8$fig$fig2$cap[language]
  )

StatBank

Method


# Transform
ARXBFB05 <- 
  ARXBFB05_raw %>% 
  filter(
    municipality == ARXBFB05_raw[[1]][1],
    time         >= year(Sys.time()) - 7
    ) %>% 
  arrange(desc(time))

vec        <- 1:2
names(vec) <- c(" ", sdg8$fig$fig2$cols$col2[language])

# Table
ARXBFB05 %>% 
  select(2, ncol(.)) %>% 
  rename(vec) %>% 
  statgl_table() %>% 
  pack_rows(index = ARXBFB05[[3]] %>% table()) %>% 
  add_footnote(ARXBFB05[[1]][1], notation = "symbol")
Employment rate
Employed persons in average per month (pct.)
2022 66,9
2021 66,7
2020 66,0
2019 66,6
2018 66,1
2017 65,3
* Total (incl. outside the municipalities)

Unemployment


FN 8.5.2 Unemployment rate by age
# Import

url <- paste0("https://bank.stat.gl/api/v1/", language, "/Greenland/AR/AR40/ARXLED3.px")

ARXLED3_raw <-
  url |> 
  statgl_fetch(
    time                 = px_all(),
    district             = "AA",
    age                  = "1",
    "inventory variable" = "P",
    .col_code            = TRUE
    ) %>% 
  as_tibble()

# Transform
ARXLED3 <-
  ARXLED3_raw %>% 
  mutate(time = time %>% make_date()) %>% 
  unite(combi, 1, 2, 4, sep = ", ")

# Plot
ARXLED3 %>% 
  ggplot(aes(
    x     = time,
    y     = value,
    color = combi
    )) +
  geom_line(size = 2) +
  theme_statgl() + 
  scale_color_statgl() +
  theme(legend.position = "none") +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 1, 
    accuracy     = 0.1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig3$title[language],
    subtitle = ARXLED3[[1]][1],
    x        = " ",
    y        = " ",
    color    = " ",
    caption  = sdg8$fig$fig3$cap[language]
  )

StatBank

Method


# Transform

ARXLED3 %>% 
  mutate(time = time %>% year()) %>% 
  filter(time > year(Sys.time()) - 8) %>% 
  spread(time, value) %>% 
  mutate(combi = sdg8$fig$fig3$cols$ncol[language][[1]]) %>% 
  rename(" " = 1) %>% 
  statgl_table()
2017 2018 2019 2020 2021 2022
Unemployment rate 5,9 5 4,3 4,5 3,7 3,2



# Import

url <- paste0("https://bank.stat.gl/api/v1/", language, "/Greenland/AR/AR40/ARXLED3.px")

ARXLED4_raw <-
  url |> 
  statgl_fetch(
    time                 = px_all(),
    district             = "AA",
    "inventory variable" = "P",
    age                  = px_all(),
    .col_code            = T
    ) %>% 
  as_tibble()

# Transform
ARXLED4 <- 
  ARXLED4_raw %>% 
  filter(age != ARXLED4_raw[[2]][1]) %>% 
  arrange(desc(time)) %>% 
  mutate(age = age %>% factor(levels = unique(age)),
         time = time %>% make_date()) %>% 
  unite(combi, 1, 4, sep = ", ")

# Plot
ARXLED4 %>% 
  ggplot(aes(
    x     = time, 
    y     = value,
    color = age
    )) +
  geom_line(size = 1.5) +
  theme_statgl() + 
  scale_color_statgl() +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 1, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig4$title[language],
    subtitle = ARXLED4[[1]][1],
    x        = " ",
    y        = " ",
    color    = " ",
    caption  = sdg8$fig$fig4$cap[language]
  )

StatBank

Method


# Transform
ARXLED4 <- 
  ARXLED4_raw %>% 
  filter(
    age != ARXLED4_raw[[2]][1],
    time >= year(Sys.time()) - 6
    ) %>% 
  arrange(desc(time)) %>% 
  mutate(
    age = age %>% factor(levels = unique(age)),
    time = time %>% factor(levels = unique(time))
    ) %>% 
  unite(combi, 1, 2, sep = ", ") %>% 
  spread(3, ncol(.))

vec        <- ARXLED4[[2]] %>% length()
names(vec) <- sdg8$fig$fig4$index[language]


# Table
ARXLED4 %>% 
  select(-1) %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  pack_rows(index = vec) %>% 
  pack_rows(index = table(ARXLED4$combi)) |> 
  add_footnote(ARXLED4_raw[[1]][1], notation = "symbol")
Unemployment rate (pct.)
Unemployment rate
Total, 18-19 years
2022 5,0
2021 6,8
2020 8,5
2019 7,6
2018 12,2
Total, 20-24 years
2022 4,2
2021 4,8
2020 6,1
2019 6,2
2018 7,8
Total, 25-29 years
2022 3,1
2021 3,2
2020 4,5
2019 4,7
2018 5,3
Total, 30-34 years
2022 3,2
2021 3,3
2020 4,4
2019 4,0
2018 4,6
Total, 35-39 years
2022 2,8
2021 3,2
2020 4,2
2019 4,0
2018 4,6
Total, 40-44 years
2022 2,7
2021 3,4
2020 3,9
2019 3,7
2018 4,0
Total, 45-49 years
2022 2,4
2021 2,9
2020 3,9
2019 4,0
2018 4,3
Total, 50-54 years
2022 3,4
2021 4,0
2020 4,4
2019 3,9
2018 4,3
Total, 55-59 years
2022 3,2
2021 3,9
2020 4,3
2019 3,7
2018 4,3
Total, 60 years-retirement age
2022 3,5
2021 3,6
2020 4,2
2019 4,2
2018 4,6
* Total
GS Unemployment rate by place of residence
# Import

url <- paste0("https://bank.stat.gl/api/v1/", language, "/Greenland/AR/AR40/ARXLED3.px")

ARXLED3_raw <-
  url |> 
  statgl_fetch(
    time                 = px_all(),
    district             = "AA",
    age                  = "1",
    "inventory variable" = "P",
    "place of residence" = px_all(),
    .col_code            = TRUE
    ) %>% 
  as_tibble()

# Transform
ARXLED3 <- 
  ARXLED3_raw %>% 
  mutate(time = time %>% make_date())

# Plot
ARXLED3 %>% 
  ggplot(aes(
    x     = time,
    y     = value, 
    color = `place of residence`
    )) +
  geom_line(size = 2) +
  theme_statgl() + 
  scale_color_statgl() +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 1, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  labs(
    title    = sdg8$fig$fig5$title[language],
    subtitle = ARXLED4[[2]][1],
    x        = " ",
    y        = " ",
    color    = " ",
    caption  = sdg8$fig$fig5$cap[language]
    )

StatBank

Method


# Transform
ARXLED3 <- 
  ARXLED3_raw %>% 
  filter(time >= year(Sys.time()) - 6) %>% 
  arrange(time) %>% 
  mutate(time = time %>% factor(levels = unique(time))) %>% 
  unite(combi, district, age, sep = ", ") %>% 
  spread(1, ncol(.))

vec        <- ARXLED3[[1]] %>% length()
names(vec) <- sdg8$fig$fig5$index[language]

# Table
ARXLED3 %>% 
  select(-c(1, 3)) %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  add_footnote(ARXLED3[[1]][1], notation = "symbol") %>% 
  row_spec(1, bold = TRUE) %>% 
  pack_rows(index = vec) |> 
  pack_rows(index = table(ARXLED3$`place of residence`))
Total, Total
Unemployment rate
Settlements etc.
2018 6,9
2019 6,1
2020 6,5
2021 5,3
2022 4,9
Total
2018 5,0
2019 4,3
2020 4,5
2021 3,7
2022 3,2
Towns
2018 4,8
2019 4,1
2020 4,3
2021 3,4
2022 3,0
* Settlements etc.



Research and development


GS Research and development expenditure (share of GDP)
# Import
NRX09_raw <-
  statgl_url("NRX09", lang = language) %>%
  statgl_fetch(
    "units"   = "L",
    "account" = px_all(),
    "time"    = px_all(),
    .col_code = TRUE
    ) %>% 
  as_tibble()

NRX09_raw <- NRX09_raw %>% filter(account %in% unique(NRX09_raw %>% pull(account))[7])

NRX10_raw <-
  statgl_url("NRX10", lang = language) %>% 
  statgl_fetch(
    "units"    = "L",
    "account"  = "01",
    "Aar"      = px_all(),
    .col_code = TRUE
    ) %>% 
  as_tibble()

# Transform
RD_GDP <- 
  NRX10_raw %>% 
  select(3:4) %>% 
  rename(
    "time" = 1,
    "GDP"  = 2
    ) %>% 
  left_join(
    NRX09_raw %>% 
      mutate(account = account %>% str_remove_all("[:digit:]") %>% trimws()) %>% 
      select(3:4) %>% 
      rename("RD" = 2)
    ) %>% 
  mutate(pct = RD / GDP) %>% 
  filter(pct != "NA")

# Plot
RD_GDP %>% 
  ggplot(aes(
    x    = time,
    y    = pct,
    fill = time
    )) +
  geom_col() +
  scale_y_continuous(labels  = scales::percent_format(
    scale        = 100, 
    accuracy     = 1, 
    big.mark     = ".",
    decimal.mark = ","
    )) +
  theme_statgl() + 
  scale_fill_statgl() +
  theme(legend.position = "none") +
  labs(
    title    = sdg8$fig$fig6$title[language],
    subtitle = NRX09_raw[[1]][1],
    x        = " ",
    y        = sdg8$fig$fig6$y_lab[language],
    caption  = sdg8$fig$fig6$cap[language]
  )

Statbank, investments (research and development)

Statbank, GDP


# Transform
tab <- 
  RD_GDP %>% 
  #arrange(desc(time)) %>% 
  filter(time >= year(Sys.time()) - 7) %>% 
  mutate(
    time = time %>% fct_inorder(),
    pct  = pct * 100,
    pct  = pct %>% round(1),
    var  = sdg8$fig$fig6$cols$col1[language]
    ) %>% 
  select(-(2:3)) %>% 
  spread(1, 2)

# Table
tab %>% 
  rename(" " = 1) %>% 
  statgl_table() %>% 
  pack_rows(index = table(NRX09_raw[[1]][1])) %>% 
  add_footnote(sdg8$fig$fig6$foot[language], notation = "symbol")
2017 2018 2019 2020 2021
Current prices, million dkk
Research and development expenditure 2,1 1,8 1,8 1,6 1,6
* Share of GDP

International passengers


GS Number of international passengers on scheduled flights
# Import
TUXUPAX_raw <-
  statgl_url("TUXUPAX", lang = language) %>%
  statgl_fetch(airport   = 0,
               month     = 0,
               time      = px_all(),
               .col_code = TRUE) %>% 
  as_tibble()

# Transform
TUXUPAX <-
  TUXUPAX_raw %>% 
  mutate(value = value / 1000,
         time = time %>% make_date())

# Plot
TUXUPAX %>% 
  ggplot(aes(
    x    = time,
    y    = value, 
    fill = airport
    )) +
  geom_col() +
  theme_statgl() + 
  scale_fill_statgl() +
  theme(plot.margin = margin(10, 10, 10, 10),
        legend.position = "none") +
  labs(
    title = sdg8$fig$fig7$title[language],
    x = " ",
    y = sdg8$fig$fig7$y_lab[language],
    caption = sdg8$fig$fig7$cap[language]
  )

StatBank

Method


# Transform
TUXUPAX <-
  TUXUPAX_raw %>% 
  mutate(value = value) %>% 
  filter(time >= year(Sys.time()) - 7,
         value != "NA") %>% 
  arrange(desc(time))

vec <- 1:2
names(vec) <- c(" ",  sdg8$fig$fig7$cols$col2[language])


# Table
TUXUPAX %>% 
  select(-(1:2)) %>% 
  rename(vec) %>% 
  statgl_table() %>% 
  add_footnote(sdg8$fig$fig7$foot[language],
               notation = "symbol")
International passengers on scheduled flights
2023 96.362
2022 85.484
2021 39.293
2020 30.785
2019 86.989
2018 85.306
2017 83.487
* Number of persons.

NEET


GS NEET
UDXUMG3_raw <- 
  statgl_url("UDXUMG3", lang = language) %>%
  statgl_fetch(
    alder        = px_all(),
    registrering = 5:7,
    aar          = px_all(),
    .col_code    = TRUE
  ) %>% 
  as_tibble()

#sdg8 <- read_yaml("S:/STATGS/VM/SDG_dokument/input/text/txt_08.yml")

lab_vec        <- 1:5
names(lab_vec) <- 
  c(
    "age",
    "time",
    sdg8$fig$fig8$tags$tag1[language] %>% unlist(),
    sdg8$fig$fig8$tags$tag2[language] %>% unlist(),
    sdg8$fig$fig8$tags$tag3[language] %>% unlist()
)


UDXUMG3 <-
  UDXUMG3_raw %>% 
  rename("status" = registrering, "age" = alder, "time" = aar) |> 
  mutate(status = status %>% fct_inorder()) %>% 
  spread(status, value) %>% 
  rename(
    "age"   = 1,
    "time"  = 2,
    "work"  = 3,
    "none"  = 4,
    "total" = 5
  ) %>% 
  mutate(edu = total - work - none) %>% 
  select(-total) %>% 
  rename(lab_vec) %>% 
  gather(status, value, -c(age, time)) %>% 
  mutate(time = time %>% as.numeric()) %>% 
  filter(time %in% c(min(time), mean(time), max(time))) %>%
  mutate(time = time %>% as.character() %>% fct_rev())
  

UDXUMG3 %>%
  ggplot(aes(
    x    = parse_number(age),
    y    = value,
    fill = status
  )) +
  geom_col(position = "fill") +
  facet_wrap(~ time) + 
  scale_x_continuous(labels = function(x) round(x)) +
  scale_y_continuous(labels = scales:: percent) + 
  scale_fill_statgl(reverse = TRUE) +
  theme_statgl() + 
  labs(
    title    = sdg8$fig$fig8$title[language],
    subtitle = sdg8$fig$fig8$sub[language],
    x        = sdg8$fig$fig8$x_lab[language],
    y        = " ",
    color    = colnames(UDXUMG3_raw)[2] %>% str_to_title(),
    caption  = sdg8$fig$fig8$cap[language]
)

StatBank

Method


tab <- 
  UDXUMG3 %>% 
  mutate(age = age %>% fct_inorder()) %>% 
  arrange(age, time, status) %>% 
  unite(combi, time, status, sep = ",") %>% 
  mutate(combi = combi %>% fct_inorder()) %>% 
  spread(combi, value)

vec      <- tab %>% select(-1) %>% colnames() %>% str_split(",") %>% unlist()
head_vec <- vec[c(TRUE, FALSE)] %>% table() %>% rev()
col_vec  <- vec[c(FALSE, TRUE)]

tab %>% 
  statgl_table(col.names = c(" ", col_vec)) %>% 
  add_header_above(c(" ", head_vec)) %>% 
  add_footnote(sdg8$fig$fig8$foot[language], notation = "symbol")
2022
2019
2016
age 2022,In education 2022,In employment 2022,NEET 2019,In education 2019,In employment 2019,NEET 2016,In education 2016,In employment 2016,NEET
16 years 347 68 292 314 84 317 390 70 295
17 years 299 136 325 290 141 358 275 127 362
18 years 303 174 260 278 220 271 298 176 325
19 years 238 266 218 230 288 205 274 300 318
20 years 167 388 221 150 372 221 171 374 264
21 years 176 360 215 159 397 225 205 389 242
22 years 149 363 177 174 462 236 219 411 233
23 years 161 390 198 169 452 189 223 472 221
24 years 187 404 199 195 482 181 227 476 197
25 years 158 519 199 194 496 173 230 487 186
* Number of persons